package com.moore.controller;

import com.moore.bean.EducationBackground;
import com.moore.bean.ProjectExperience;
import com.moore.bean.Resume;
import com.moore.bean.WorkExperience;
import com.moore.dto.ResponseData;
import com.moore.service.ResumeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/resume")
@RestController
public class ResumeController {

    @Autowired
    private ResumeService resumeService;

    //获取用户简历
    @RequestMapping("/getUserResume")
    private ResponseData getUserResume(Integer candidateId){
        return resumeService.getUserResume(candidateId);
    }
    //修改用户简历
    @RequestMapping("/updateUserResume")
    private ResponseData updateUserResume(@RequestBody Resume resume){
        return resumeService.updateUserResume(resume);
    }
    //获取用户的工作经历
    @RequestMapping("/getUserWorkExp")
    private ResponseData getUserWorkExp(Integer resumeId){
        return resumeService.getUserWorkExp(resumeId);
    }
    //添加用户工作经历
    @RequestMapping("/addUserWorkExp")
    private ResponseData addUserWorkExp(@RequestBody WorkExperience workExperience){
        System.out.println(workExperience);
        return resumeService.addUserWorkExp(workExperience);
    }
    //修改用户工作经历
    @RequestMapping("/updateUserWorkExp")
    private ResponseData updateUserWorkExp(@RequestBody WorkExperience workExperience){
        return resumeService.updateUserWorkExp(workExperience);
    }
    //删除用户的工作经历
    @RequestMapping("/delUserWorkExp")
    private ResponseData delUserWorkExp(Integer experienceId){
        return resumeService.delUserWorkExp(experienceId);
    }
    //获取用户项目经历
    @RequestMapping("/getUserProExp")
    private ResponseData getUserProExp(Integer resumeId){
        return resumeService.getUserProExp(resumeId);
    }
    // 添加用户项目经理
    @RequestMapping("/addUserProExp")
    private ResponseData addUserProExp(@RequestBody ProjectExperience projectExperience){
        return resumeService.addUserProExp(projectExperience);
    }
    //修改用户项目经历
    @RequestMapping("/updateUserProExp")
    private ResponseData updateUserProExp(@RequestBody ProjectExperience projectExperience){
        return resumeService.updateUserProExp(projectExperience);
    }
    //删除用户项目经历
    @RequestMapping("/delUserExp")
    private ResponseData delUserExp(Integer id){
        return resumeService.delUserExp(id);
    }
    //获取用户教育经历
    @RequestMapping("/getUserEduExp")
    private ResponseData getUserEduExp(Integer resumeId){
        return resumeService.getUserEduExp(resumeId);
    }
    //添加用户教育经历
    @RequestMapping("/addUserEduExp")
    private ResponseData addUserEduExp(@RequestBody EducationBackground educationBackground){
        return resumeService.addUserEduExp(educationBackground);
    }
    //修改教育经历
    @RequestMapping("/updateEduExp")
    private ResponseData updateEduExp(@RequestBody EducationBackground educationBackground){
        return resumeService.updateEduExp(educationBackground);
    }
    //删除教育经历
    @RequestMapping("/delEduExp")
    private ResponseData delEduExp(Integer id){
        return resumeService.delEduExp(id);
    }
}
